//
//  ZGuessController.m
//  NewProject
//
//  Created by 陈洪鑫 on 2018/4/13.
//  Copyright © 2018年 chenIos. All rights reserved.
//

#import "ZSettingController.h"
#import "ZChangeWalletListCell.h"
#import "ZSwitchCurrencyController.h"
//#import <Foundation/Foundation.h>
@interface ZSettingController ()<UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
@property(nonatomic,strong)UICollectionView *collectionView;
@end

@implementation ZSettingController

- (UICollectionView *)collectionView
{
    if (!_collectionView) {
        CGFloat navHeight = iPhoneX ? 88 + 34 : 64;
        
        _collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - navHeight) collectionViewLayout:[UICollectionViewFlowLayout new]];
        _collectionView.backgroundColor = [UIColor whiteColor];
        [_collectionView registerNib:[UINib nibWithNibName:@"ZChangeWalletListCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"ZChangeWalletListCell"];
        _collectionView.dataSource = self;
        _collectionView.delegate = self;
    }return _collectionView;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.title = Z_Location(@"setting");
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.collectionView];
}
- (void)saveAction{
    
}

#pragma mark -- UICollectionViewDataSource
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{
    return 1;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    
    return 1;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    
    ZChangeWalletListCell *cell =  [collectionView dequeueReusableCellWithReuseIdentifier:@"ZChangeWalletListCell" forIndexPath:indexPath];
    [cell.selectedBtn setImage:[UIImage imageNamed:@"more_data"] forState:UIControlStateNormal];
    cell.titlelabel.text = Z_Location(@"currencyUnit");
    //    [cell.titleBtn setTitleColor:[UIColor colorWithHexString:@"#707275"] forState:UIControlStateNormal];
    //    cell.titleBtn.titleLabel.font = H_Medium4;
    //    [cell.titleBtn setTitle:self.setItems[indexPath.section] forState:UIControlStateNormal];
    cell.backgroundColor = [UIColor whiteColor];
    return cell;
    
}


#pragma mark -- UICollectionViewDelegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    [self.navigationController pushViewController:[ZSwitchCurrencyController new] animated:YES];
}

#pragma mark -- UICollectionViewDelegateFlowLayout


- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
    CGFloat width = SCREEN_W;
    
    return CGSizeMake(width, 50);
    
    
}
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{
    return UIEdgeInsetsZero;
    
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
    return 0;
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section{
    return 0;
}
//- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section;
//- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section;



@end
